import Vue from 'vue'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import '../src/assets/css/global.css'
import axios from 'axios'
import router from './router'
import echarts from 'echarts'
import App from './App.vue'

Vue.use(ElementUI)

axios.defaults.baseURL="/api"; //前缀
Vue.prototype.$http = axios
Vue.prototype.$echarts = echarts

axios.interceptors.request.use((req)=>{
  //获取token
  let token = sessionStorage.getItem("token");
  if(token!=null){
    req.headers.token=token;
  }
  return req;
});

Vue.config.productionTip = false

new Vue({
  router,
  render: h => h(App),
}).$mount('#app')
